
function rotateTest() {
//  tb.rotateLeft();
//  tp.rotateRight();
/*
  if (!tp.drop()) {
    tp = new Piece();
    tp.setTransform(0, 0, 0);
    tp.set();
  }
  setTimeout(rotateTest, 500);
*/
}



var tb = null;
var tp = null;
function onLoadObjects() {

//  $('test_div').innerHTML = dumpObj(objectGlobals.gameBoard, 'gb', "<br />", 1);


//  tb = new Block(0, true, true, true, true);
//  tb.setPosition(2, 0);
//  document.getElementById("game_board").appendChild(tb.div);

//  tp = new Piece();
//  tp.setTransform(0, 0, 0);
//  tp.set(); 






//  $('test_div').innerHTML = dumpObj(tb, 'tb', "<br />", 1);
/*
  for (var i = 0; (i < 25); i++) {
  var b = new Block(0, true, true, true, true);
  b.setPositionAndAnimation(
    Math.round(Math.random() * 11),
    Math.round(Math.random() * 22));
    document.getElementById("game_board").appendChild(b.div);

  }
*/
//window.alert('in onLoadObjects');

/*
  for( var i = 0; (i < 12); i++) {
    for( var j = 0; (j < 23); j++) {
      var b = new Block(Math.round(Math.random() * 6), true, true, true, true);
      b.setPosition( i, j);
        document.getElementById("game_board").appendChild(b.div);


    }
  }
*/
  setTimeout(rotateTest, 200);
}

Event.observe(window, 'load', onLoadObjects);




//$(window).bind('load', onLoadObjects);

var MAX_DUMP_DEPTH = 1;

function dumpObj(obj, name, indent, depth) {
  if (depth > MAX_DUMP_DEPTH) {
     return indent + name + ": <Maximum Depth Reached>\n";
  }
  if (typeof obj == "object") {
     var child = null;
     var output = indent + name + "\n";
     indent += "\t";
     for (var item in obj)
     {
       try {
         child = obj[item];
       } catch (e) {
         child = "<Unable to Evaluate>";
       }
       if (typeof child == "object") {
         output += dumpObj(child, item, indent, depth + 1);
       } else {
         output += indent + item + ": " + child + "\n";
       }
     }
     return output;
  } else {
     return obj;
  }
}

